<?php
/**
*	@author SignpostMarv Martin
*	@package UHU
*	@subpackage HTTP
*/

/**
*	Intended to provide an interface to $_SERVER['HTTP_ACCEPT'] to allow UHU Applications to do content negotation
*	A little messy at the moment, will be re-written to better handle IE's lameness in this area.
*	@package UHU
*	@subpackage HTTP
**/
class uhu_HTTP_ACCEPT
{
	protected $MIME;
	protected $quality;
	public function __construct($chunk)
	{
		if(strpos($chunk,';') !== false)
		{
			list($this->MIME,$this->quality) = explode(';',$chunk);
			$this->quality = (float)substr($this->quality,2);
		}
		else
		{
			$this->MIME = $chunk;
			$this->quality = 1.0;
		}
	}
	public function MIME()
	{
		return $this->MIME;
	}
	public function q()
	{
		return $this->quality;
	}
}
?>